# -*- coding: utf8 -*-
from MySQLdb import *
import _mysql
import MySQLdb
import datetime

def conn():
    conn = MySQLdb.connect(host='localhost',user='root',passwd='760218',db='wordpress',use_unicode=True,charset='utf8')
    #id = '27'
    #name = 'test1'
    conn.query('select * from restful')
    #print conn.character_set_name()
    r = conn.use_result()
    #rr = conn.store_result()

    #print r.num_rows()
    ss = r.fetch_row()
    resultLen = len(ss)

    for i in range(resultLen):
        print ss[i][0]
        print '=========================='
        break;

    
    #print conn.get_host_info()
    #print conn.get_server_info()
    #print conn.info()
    
    
    #cnt = MySQLdb.connect(host='localhost',user='root',passwd='760218',db='wordpress',use_unicode=True,charset='utf8')

    #charset = cnt.character_set_name()    
    #cur = cnt.cursor()
    #db = cur._get_db()
    #for i in range(9999999):
    #    name="123"+str(datetime.datetime.now());
    #    cur.execute("insert into restful(name)values('%s')"%name)
    #    cnt.commit()
        
    #print charset    
    #print cnt.get_character_set_info()
    #cur.close()
    conn.close()
    
conn()    
